GXX = g++
TARGETLIB = ../libUdpSocket.so
TARGET = client
DEBUG = 
EXISTLIB=$(shell if [ -f $(TARGETLIB) ]; then echo "-rm $(TARGETLIB)"; else echo "";fi;)

all:
	$(GXX) $(DEBUG) -c -fPIC ../UdpSocket.cpp
	$(GXX) $(DEBUG) -c -fPIC client.cpp
	$(GXX) $(DEBUG) -shared -fPIC -o $(TARGETLIB) UdpSocket.o
	$(GXX) $(DEBUG) -o $(TARGET) client.o $(TARGETLIB)

.PHONY:clean
clean:
	-rm -f *.o $(TARGET)
	$(EXISTLIB)
